<template>
	<view>
		<view class="room_screen_box">
			<text class="room_screen_title">{{title}}</text>
			<view class="room_screen_list">
				<view class="item" v-for="(item,index) in itemData" :key="index">
					<text @tap="itemClick(index)" :class="[index == itemClick_index?'select_item':'room_screen_item']">{{item}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "room_cell",
		props: {
			title: {
				type: String,
				default () {
					return "标题"
				}
			},
			itemData: {
				type: Array,
				default () {
					return []
				}
			}
		},
		data() {
			return {
				itemClick_index:null,
			};

		},
		
		created() {

		},
		methods:{
			itemClick(index){
				this.itemClick_index = index
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	.select_item {
		background-color: #ecf5ff;
		color: #3c9cff;
		border: 0.8px solid #3c9cff;
		font-size: 24upx;
		width: 136upx;
		height: 60upx;
		text-align: center;
		line-height: 60upx;
	}
	.room_screen_box {
		width: 90%;
		margin: 34upx auto;

		.room_screen_title {
			font-size: 28upx;
			color: #333333;
		}
	
	.room_screen_list {
			margin-top: 15rpx;
			width: 96%;
			display: flex;
			flex-wrap: wrap;
			margin: 20upx auto;
			.item {
				flex-wrap: wrap;
				display: flex;
				justify-content: center;
				align-items: center;
				margin-bottom: 5px;
				margin-top: 20upx;
				margin-left: 19upx;
				.room_screen_item {
					width: 136upx;
					height: 60upx;
					font-size: 24upx;
					color: #999999;
					border: 1px solid #e6e6e6;
					text-align: center;
					line-height: 60upx;
				}


			}

		}


	}
</style>
